<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
<meta charset="UTF-8"/>
<title>运营平台</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta name="renderer" content="webkit">
<!--<meta http-equiv="X-UA-Compatible" content="IE=edge">-->
<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/common.css?v=20170207" />
<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/table.css?v=20170117" />
<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/jquery-ui.css" />
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery-1.11.1.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery-ui.min.js" type="text/javascript"></script>
 <script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/yunIndex.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery-ym-datePlugin-0.1.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/global.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/cheshan/js/common.js" type="text/javascript"></script>
<script type="text/javascript" src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery.placeholder.min.js"></script>
<script type="text/javascript">
 $(function(){
     $("input").placeholder();
     if (navigator.userAgent.indexOf("Safari") > -1) {
       $("input").css("lineHeight","normal !important");
     };
});
</script>

<script src="<?php echo get_style_cdnurl();?>paimai/yunying/plugin/ztree/jquery.ztree.core-3.5.js" type="text/javascript"></script>
<script type="text/javascript">
    var setting = {
        data: {
            simpleData: {
                enable: true
            }
        },
        callback:{
            onClick: zTreeOnClick
        }
    };

    var zNodes =[
    <?php foreach($departs as $item):?>
    {id:<?php echo $item['id'];?>, pId:<?php echo $item['pid'];?>, name:"<?php echo $item['name'];?>",<?php echo $item['id']==1 ? "open: true" : '' ;?>},
    <?php endforeach;?>
    ];

    function zTreeOnClick( event, treeId, treeNode){
        //console.log(treeNode);
        $("#depart_id").val(treeNode.id);
        $("#onadd").val(treeNode.name);
        $(".employee ul .zTreeDemoBackground").fadeOut();
    }
    $(document).ready(function(){
        $.fn.zTree.init($("#tree"), setting, zNodes);

        $("#onadd").click(function(){
            $(".employee ul .zTreeDemoBackground").fadeToggle();
            $("#tree").show();
        })

        $(".employee ul li .menList").click(function(event){
                $(this).siblings("ul").fadeIn()
                $(this).parent().siblings("li").find("ul").fadeOut();
                event.stopPropagation();
        });
        $(".zTreeDemoBackground").click(function(event){       
            event.stopPropagation();
        })
    
        $("body").click(function(event){
            $(".employee ul li .menbox").fadeOut();
            $(".employee ul .zTreeDemoBackground").fadeOut();
            event.stopPropagation();
        })
    });

    function popup(opp){
         $(opp).parent().siblings("input").val($(opp).html());
         $(opp).parent().fadeOut();
    }
    
</script>

</head>

<body>
<body>
<div class="header">
<div class="headerCo">
<span>你好,<?php echo ($user_info["real_name"]); ?><a href="<?php echo (WEB_URL); ?>Emp/logout">退出</a></span>
<h1><img src="<?php echo get_style_cdnurl();?>paimai/yunying/images/yun_logo.jpg"></h1>
</div>
</div>

<div class="mian">
    <div class="mianL">
    <dl>
        <dd>
            <a id="menu_sy" href="/Index/index" class="shouye">首页</a>
        </dd>
        <?php foreach ($tree_menu as $key => $value): ?>
          <dd>
            <span id="menu_<?php echo ($value['first_char']); ?>" ><img src="<?php echo get_style_cdnurl();?>paimai/yunying/images/yun_jia.jpg"><?php echo ($value['name']); ?></span>
            <ul style="display: none;">
                <?php if (!empty($value['children'])): ?>
                    <?php foreach ($value['children'] as $k => $v): ?>
                        <li><a id='menu_<?php echo ($v["first_char"]); ?>' href="<?php echo ($v['url']); ?>"><?php echo ($v['name']); ?></a></li>
                    <?php endforeach ?>
                <?php endif ?>
            </ul>
        <?php endforeach ?>
    </dl>
</div>

<?php $menu = 'zhgl.ygzh'; ?>
<?php $menu=json_encode(explode('.', $menu)); ?>
<script>
    $(function () {
        var cur_menu = '<?php echo ($menu); ?>', cur_menu = eval('[' + cur_menu + ']'), cur_menu = cur_menu[0];
        if (cur_menu == "sy") {
            $("#menu_sy").removeClass('shouye').addClass('current');
        }
        $('#menu_' + cur_menu[0]).click();
        $('#menu_' + cur_menu[0]).find("img").attr("src", "http://img1.isou365.cn/paimai/yunying/images/yun_jie.jpg");
        $(".mianL").css("height", $(document).height() - 95);
        $('#menu_' + cur_menu[1]).addClass('current');
    });
</script>
        <div class="mianR">
            <h3 class="yonghu">员工账号</h3>
            <div class="shangFrom shangFrom1 clearfix">
                <div class="chang-ci">
                    <!-- <input type="button" value="分组管理" class="feiyong" /> -->
                </div>
            </div>
            <div class="employee">
                <form action="/Emp/ci_edit" method="post" id="editForm" >
                    <input type="hidden" name="emp_id" value="<?php echo ($emp["emp_id"]); ?>" />
                    <ul class="clearfix">
                        <li>
                            <span>*用户名</span>
                            <input type="text" readonly name="username" value="<?php echo ($emp["username"]); ?>" />
                        </li>
                        <li>
                            <span>*真实姓名</span>
                            <input type="text" name="real_name" value="<?php echo ($emp["real_name"]); ?>" />
                        </li>
                        <li>
                            <span>邮箱</span>
                            <input type="text" name="email" value="<?php echo ($emp["email"]); ?>" />
                        </li>
                        <li>
                            <span>*手机</span>
                            <input type="text" name="mobile"  value="<?php echo ($emp["mobile"]); ?>" />
                        </li>

                        <li>
                            <span>*部门</span>
                            <input type="text" id="onadd"  class="menList" readonly value="<?php echo ($emp["depart_name"]); ?>">
                            <div class="zTreeDemoBackground left">
                                <ul id="tree" class="ztree"></ul>
                            </div>
                        </li>
                        <input type="hidden" id="depart_id" name="depart_id" value="<?php echo ($emp["depart_id"]); ?>" />
                    </ul>
                </form>
            </div>
            <div class="yongBtn">
                <input type="submit" value="保存" class="queding" id="submitForm" />
                <input name="重置" type="reset" class="quxiao" onclick="history.go(-1);" value="取消" />
            </div>
        </div>

    <div class="clear"></div>
</div>
<script >
   $("#submitForm").click(function () {
       $(".yunBei").css("display","block");
       $.post('/Emp/ci_edit',$("#editForm").serialize(),function (data) {
           if(data.code!=200){
               shibai_alert1(data.msg,500,function () {
                   $(".yunBei").css("display","none")
               })
               return false
           }
           btn_alert("保存成功",500,function () {
               location.href="/Emp/index"
           })
       },'json')
   }) 
</script>
<!--审核通过-->

<div class="yunBei"></div>
<div class="loading"></div>
</body>
</html>